import matplotlib.pyplot as plt

# # 数据
# x = [1, 2, 3, 4, 5]
# y = [10, 20, 25, 30, 35]
#
# # 绘图  折线图
# plt.plot(x, y, marker='o')
# plt.title('Line Plot')
# plt.xlabel('X-axis')
# plt.ylabel('Y-axis')
# plt.grid(True)
#
# # 显示图形
# plt.show()


# 数据
categories = ['A', 'B', 'C', 'D']
values = [4, 7, 1, 8]

# 绘图  柱状图
plt.bar(categories, values, color='skyblue')
plt.title('Bar Plot')
plt.xlabel('Categories')
plt.ylabel('Values')

# 显示图形
plt.show()

# 数据
# labels = ['A', 'B', 'C', 'D']
# sizes = [15, 30, 45, 10]
# colors = ['gold', 'yellowgreen', 'lightcoral', 'lightskyblue']
# explode = (0, 0.1, 0, 0)
#
# # 绘图   饼图
# plt.pie(sizes, explode=explode, labels=labels, colors=colors, autopct='%1.1f%%', shadow=True, startangle=140)
# plt.title('Pie Chart')
#
# # 显示图形
# plt.show()





